package com.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/myPath")
public class PathVariableController {

    /**
     *
     * @return
     */
    @RequestMapping(value = "/index",name = "name是注释用的 加不加无所谓")
    public String index(){
        return "index";
    }

    @RequestMapping("/path/{id}/{userName}/{password}")
    public String pathVariable(
            @PathVariable("id")Integer id,
            @PathVariable("userName")String name,
            @PathVariable("password")String password){
        System.out.println("id="+id);
        System.out.println("name="+name);
        System.out.println("password="+password);
        return "success";
    }

}
